<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
  <title>会员运营数据分析</title>
  <link rel="icon" href="favicon.ico" type="image/ico">
  <link href="css/bootstrap.min.css" rel="stylesheet">
  <link href="css/materialdesignicons.min.css" rel="stylesheet">
  <link href="css/style.min.css" rel="stylesheet">
</head>

<body>
<div class="container-fluid p-t-15">

  <div class="row">
    <div class="col-sm-12">
      <div class="card">
        <div class="card-header bg-info">
          <h4>会员运营数据分析</h4>
        </div>
      </div>
    </div>
  </div>

  <div class="row">
    <div class="col-sm-12 col-md-4">
      <div class="card">
        <div class="card-body">
          <div class="clearfix">
            <div class="pull-left">
              <p class="text-muted">总用户注册数</p>
              <h2>22217</h2>
            </div>
            <div class="pull-right">
              <span class="img-avatar img-avatar-48 bg-success"><i class="mdi mdi-account fa-1-5x"></i></span>
            </div>
          </div>
          <div>
            <span class="text-success m-r-5">
              <span class="mdi mdi-arrow-up"></span> 1.9%
            </span> 相比昨天上涨
          </div>
        </div>
      </div>
    </div>
    <div class="col-sm-12 col-md-4">
      <div class="card">
        <div class="card-body">
          <div class="clearfix">
            <div class="pull-left">
              <p class="text-muted">今日新增用户数</p>
              <h2>237</h2>
            </div>
            <div class="pull-right">
              <span class="img-avatar img-avatar-48 bg-success"><i class="mdi mdi-account fa-1-5x"></i></span>
            </div>
          </div>
          <div>
            <span class="text-success m-r-5">
              <span class="mdi mdi-arrow-up"></span> 1.9%
            </span> 相比昨天上涨
          </div>
        </div>
      </div>
    </div>
    <div class="col-sm-12 col-md-4">
      <div class="card">
        <div class="card-body">
          <div class="clearfix">
            <div class="pull-left">
              <p class="text-muted">昨日新增用户数</p>
              <h2>217</h2>
            </div>
            <div class="pull-right">
              <span class="img-avatar img-avatar-48 bg-danger"><i class="mdi mdi-account fa-1-5x"></i></span>
            </div>
          </div>
          <div>
            <span class="text-danger m-r-5">
              <span class="mdi mdi-arrow-down"></span> 1.9%
            </span> 相比今天下降
          </div>
        </div>
      </div>
    </div>
  </div>

  <div class="row">
    <div class="col-md-6">
      <div class="card">
        <div class="card-header">
          <h4>本周用户</h4>
        </div>
        <div class="card-body">
          <canvas class="user-data"></canvas>
        </div>
      </div>
    </div>
    <div class="col-md-6">
      <div class="card">
        <div class="card-header">
          <h4>上周用户</h4>
        </div>
        <div class="card-body">
          <canvas class="old-user-data"></canvas>
        </div>
      </div>
    </div>
  </div>

</div>

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/main.min.js"></script>
<!--图表插件-->
<script type="text/javascript" src="js/Chart.js"></script>
<script type="text/javascript">

  var userBars = $('.user-data')[0].getContext('2d'),oldUserBars = $('.old-user-data')[0].getContext('2d');

  var userBarsCnt = {
    labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
    datasets: [{
        label: '注册用户',
        borderWidth: 1,
        borderColor: 'rgba(0,0,0,0)',
        backgroundColor: 'rgba(51,202,185,0.5)',
        hoverBackgroundColor: "rgba(51,202,185,0.7)",
        hoverBorderColor: "rgba(0,0,0,0)",
        data: [2500, 1500, 1200, 3200, 4800, 3500, 1500]
    }]};

  new Chart(userBars, {
    type: 'bar',
    data: userBarsCnt
  });

  var oldUserBarsCnt = {
    labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
    datasets: [{
        label: '注册用户',
        borderWidth: 1,
        borderColor: 'rgba(0,0,0,0)',
        backgroundColor: 'rgba(51,202,185,0.5)',
        hoverBackgroundColor: "rgba(51,202,185,0.7)",
        hoverBorderColor: "rgba(0,0,0,0)",
        data: [2500, 1500, 1200, 3200, 4800, 3500, 1500]
    }]};

  new Chart(oldUserBars, {
    type: 'bar',
    data: oldUserBarsCnt
  });

</script>
</body>
</html>